package com.csk.zsk.compents.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.csk.zsk.commons.entity.IdEntity;
@Entity
@Table(name = "BOOK_CHAPTERS")
@JsonIgnoreProperties({ "url","book" })
public class BookChapters extends IdEntity{
	private String name;
	private Integer num;
	private String content;
	private String url;
	private Book book;
	
	public BookChapters(){}
	public BookChapters(String id,String name,Integer num,Book book){
		this.name = name;
		this.id = id;
		this.num = num;
		this.book = book;
		this.content = "";
		this.url = "";
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getNum() {
		return num;
	}
	public void setNum(Integer num) {
		this.num = num;
	}
	
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "bookid")
	public Book getBook() {
		return book;
	}
	public void setBook(Book book) {
		this.book = book;
	}
	
	
}
